import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/Layout'

const routes = [
  // {
  //   path: '/',
  //   redirect: '/login'
  // },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '../views/Login/index.vue')
  },
  {
    path: '/',
    redirect: '/product',
    name: 'home',
    component: Layout,
    children: [
      {
        path: 'product',
        nameL: 'product',
        component: () => import('../views/product/index.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
